extends Control


var data = null

signal view(data)
signal edit(data)
signal delete(data)

func _ready():
	pass 

func set_data(data):
	self.data = data
	var id = data["id"]
	
	$hbox/id.text = str(id)
	var pokeId = data["pokeId"]
	var item = DataSource.get_spirit_by_id(pokeId)
	
	$hbox/name.text = "%s【%s】" %[item["name"], item["id"]]
	$hbox/level.text = str("LV.", data["maxLevel"])
	$hbox/count.text = str(data.get("maxCount",1))
	$hbox/desc.text = data.get("remark","")
	

func _on_view_button_up():
	emit_signal("view", data)


func _on_edit_button_up():
	emit_signal("edit", data)


func _on_delete_button_up():
	emit_signal("delete", data)
